import { NextFunction, Request, Response } from "express";
import {createUserLikePost} from './like.service'

export const storeUserLikePost = async (request:Request,response:Response,next:NextFunction)=>{
    const {postId}=request.params;
    const {id:userId}=request.user;
    console.log(postId,userId)

    try {
        const data=await createUserLikePost(userId,parseInt(postId,10))
        // 201 created 已创建
        response.status(201).send(data)
    } catch (error) {
        next(error)   
    }
}